Top 10k strings from Replace (1992)(Salmi, Timo).bas
in <root> / bin / z80 / software / Sinclair Spectrum Collection TOSEC.exe / Sinclair ZX-81 & Sinclair QL - Various / Sinclair QL - Various (TOSEC-v2006-04-09) /
Back to the directory listing
1 920 END REPeat runko 1 900 END IF 1 890 CLS#0:AT rv%+4,0:p_valmis(1):STOP 1 880 IF NOT f_vielako THEN 1 870 PAPER 2:INK 7:AT rv%+2,0:PRINT"READY, CREATED"!f2$ 1 850 CLOSE#5:CLOSE#u% 1 830 IF sama% THEN PRINT#u%,apu$(1 TO j%); 1 810 END REPeat lue 1 800 END IF 1 790 END IF 1 780 j%=j%+1:GO TO 670 1 760 j%=1:sama%=0:GO TO 610 1 750 PRINT#u%,apu$(1 TO j%); 1 740 IF (ero% AND m$<>a$(j%+1)) OR (NOT ero% AND NOT m$==a$(j%+1)) THEN 1 730 m$=INKEY$(#5,-1):apu$=apu$&m$ 1 720 IF EOF(#5) THEN EXIT lue 1 700 j%=1:sama%=0:NEXT lue 1 690 lask%=lask%+1:AT rv%,tab%:PRINT lask% 1 680 PRINT#u%,b$; 1 670 IF j%=pit% THEN 1 660 apu$=m$:sama%=1 1 650 END IF 1 640 IF NOT m$==a$(1):PRINT#u%,m$;:NEXT lue:END IF 1 620 IF m$<>a$(1):PRINT#u%,m$;:NEXT lue:END IF 1 610 IF ero% THEN 1 600 m$=INKEY$(#5,-1) 1 590 IF EOF(#5) THEN EXIT lue 1 580 REPeat lue 1 560 AT rv%,tab%:PRINT lask% 1 550 j%=1:sama%=0:lask%=0:tab%=9 1 540 pit%=LEN(a$) 1 530 STRIP 7:INK 0 1 520 AT rv%,0:PRINT"REPLACED:" 1 510 rv%=rv%+2 1 500 PAPER 2:INK 7 1 480 DELETE f2$:OPEN_NEW#u%,f2$ 1 460 OPEN_IN#5,f1$ 1 440 rv%=rv%+2:IF NOT f_vahvistus THEN GO TO 360 1 420 rv%=rv%+1:ero%=f_erota 1 400 END REPeat kysy 1 390 IF b$<>"" THEN EXIT kysy 1 380 rv%=rv%+1:b$=f_milla$ 1 370 rv%=jemma%:a$=f_mika$ 1 360 REPeat kysy 1 3550 END DEFine f_vahvistus 1 3540 END REPeat kysy 1 3530 p_beep1 1 3520 IF vl$=="y" THEN RETurn 1 1 3510 IF vl$=="n" THEN RETurn 0 1 3500 AT rv%,18:clb=KEYROW(0):INPUT vl$:CLS 2 1 350 rv%=rv%+2:jemma%=rv% 1 3490 PRINT"SATISFIED? (Y/N)?" 1 3480 AT rv%,0:PAPER 2:INK 7:CLS 3 1 3470 REPeat kysy 1 3460 LOCal vl$(2),kysy 1 3450 DEFine FuNction f_vahvistus 1 3430 END DEFine f_erota 1 3420 END REPeat kysy 1 3410 p_beep1 1 3400 IF vl$=="y" THEN RETurn 0 1 3390 IF vl$=="n" THEN RETurn 1 1 3380 IF vl$="" THEN vl$="y" 1 3370 AT rv%,31:clb=KEYROW(0):INPUT vl$:CLS 2 1 3360 PRINT"IGNORE UPPER/LOWER CASE (Y/N)? Y" 1 3350 AT rv%,0:PAPER 2:INK 7:CLS 3 1 3340 REPeat kysy 1 3330 LOCal vl$(2),kysy 1 3320 DEFine FuNction f_erota 1 3300 END DEFine f_milla$ 1 3290 RETurn ml$ 1 3280 END IF 1 3270 RETurn "" 1 3260 PRINT"LENGTHS DO NOT AGREE" 1 3250 p_beep1:STRIP 6:INK 2 1 3240 IF LEN(ml$)<>LEN(a$) THEN 1 3230 AT rv%,16:clb=KEYROW(0):INPUT ml$:CLS 2 1 32260 END DEFine vsave 1 32250 PRINT#0,"Saved"!bvl$!"version"!ver1%;".";ver% 1 32240 LIST#3,32130 TO:CLOSE#3 1 32230 PRINT#3,"32120 ver1%=";ver1%;":ver2%=";ver% 1 32220 LIST#3,100 TO 32110 1 32210 PRINT#3,"4 :" 1 32200 PRINT#3,"3 REMark version"!ver1%;".";ver% 1 3220 PRINT"WITH STRING?"; 1 32190 PRINT#3,"2 REMark ";DAY$!DATE$ 1 32180 PRINT#3,"1 REMark ";avl$!"(c) Timo Salmi" 1 32170 DELETE bvl$:OPEN_NEW#3,bvl$:ver%=ver2%+1 1 32160 bvl$=dvl$(dr)&avl$ 1 32150 dvl$(5)="ram1_":dvl$(6)="ram2_" 1 32140 dvl$(3)="fdk1_":dvl$(4)="fdk2_" 1 32130 dvl$(1)="mdv1_":dvl$(2)="mdv2_" 1 32120 ver1%=1:ver2%=1 1 32110 BEEP 4000,12:STOP:END IF 1 32100 PRINT#0,DAY$!DATE$!"Not saved, set SDATE" 1 3210 AT rv%,0:PAPER 2:INK 7:CLS 3 1 32090 IF bvl$<>1992 THEN 1 32080 bvl$=DATE$:bvl$=bvl$(1 TO 4) 1 32070 LOCal avl$(42),bvl$(42),dvl$(6,5):avl$="replace_bas" 1 32060 DEFine PROCedure vsave(dr) 1 32050 vsave 6:STOP 1 32040 vsave 5:STOP 1 32030 vsave 4:STOP 1 32020 vsave 3:STOP 1 32010 vsave 2:STOP 1 32000 vsave 1:STOP 1 3200 LOCal ml$(pmax%) 1 320 f2$=f1$&"_tmp" 1 31990 STOP 1 3190 DEFine FuNction f_milla$ 1 3170 END DEFine f_mika$ 1 3160 END REPeat kysy 1 3150 RETurn ml$ 1 3140 END IF 1 3130 NEXT kysy 1 3120 PRINT"MAXIMUM LENGTH"!pmax%!"BYTES" 1 31180 END DEFine reset 1 31170 SCALE 100,0,0:FILL 0 1 31160 PAPER#0,0:INK#0,7:INK 7:CLS 1 31150 END IF 1 31140 FOR il=0,1,2:CSIZE#il,1,0:END FOR il 1 31130 PAPER 0:BORDER 1,4 1 31110 END DEFine reset 1 31100 SCALE 100,0,0:FILL 0 1 3110 p_beep1:STRIP 6:INK 2 1 31090 PAPER#0,0:INK#0,7-3*(i=0):INK 7:CLS 1 31080 FOR il=0,1,2:CSIZE#il,(i=4)+2*(i=8),0:END FOR il 1 31070 PAPER 2*(i=8):BORDER (i=4),4*(i=4) 1 31060 WINDOW 448+8*(i=4),200+2*(i=4),32-4*(i=4),16-(i=4) 1 31050 WINDOW#2,448,200,32,16:PAPER#2,1:INK#2,7 1 31040 WINDOW#0,448,40-(i=4),32,216+(i=4) 1 31030 WINDOW 512,256,0,0:PAPER 0:CLS 1 31020 FOR il=1,2:OPEN#il,con_:END FOR il 1 31010 LOCal il:MODE i 1 31000 DEFine PROCedure reset(i) 1 3100 IF LEN(ml$)>pmax% THEN 1 310 rv%=1:f1$=f_mista$ 1 3090 END IF 1 3080 NEXT kysy 1 3070 p_beep1:STRIP 6:INK 2:PRINT"NO STRING" 1 30600 END DEFine f_vielako 1 3060 IF ml$="" THEN 1 30590 END REPeat loop 1 30580 IF key=27:RETurn 0:END IF 1 30570 IF key=240:PAPER#cl,0:CLS#cl:RETurn 1:END IF 1 30560 key=CODE(INKEY$(-1)) 1 30550 REPeat loop 1 30540 clb=KEYROW(0) 1 30530 PRINT#cl,"AGAIN: F3, EXIT: ESC"; 1 30520 cl=0:PAPER#cl,0:CLS#cl 1 30510 LOCal key,cl,loop 1 30500 DEFine FuNction f_vielako 1 3050 AT rv%,16:clb=KEYROW(0):INPUT ml$:CLS 2 1 3040 PRINT"REPLACE STRING?"; 1 3030 AT rv%,0:PAPER 2:INK 7:CLS 3 1 3020 REPeat kysy 1 3010 LOCal ml$(pmax%+1),kysy 1 30090 END DEFine p_valmis 1 30080 PRINT#ch%,!sl!"sec" 1 30070 IF ml>0 OR tl>0 THEN PRINT#ch%,!ml!"min"; 1 30060 IF tl>0 THEN PRINT#ch%,!tl!"h"; 1 30050 ml=INT(sl/60):sl=sl-60*ml 1 30040 tl=INT(sl/3600):sl=sl-tl*3600 1 30030 sl=DATE-kokoaika 1 30020 PRINT#ch%,"Elapsed time"; 1 30010 LOCal tl,ml,sl 1 30000 DEFine PROCedure p_valmis(ch%) 1 3000 DEFine FuNction f_mika$ 1 3 REMark version 1.1 1 27630 END DEFine f_onkof 1 27620 CLOSE#5:DELETE hl$:RETurn fon 1 27610 END REPeat etsi 1 27600 IF fbl$==al$:fon=1:EXIT etsi:END IF 1 27590 INPUT#5,al$ 1 27580 IF EOF(#5):fon=0:EXIT etsi:END IF 1 27570 REPeat etsi 1 27560 fbl$="":IF LEN(f$)>5 THEN fbl$=f$(6 TO) 1 27550 CLOSE#6:OPEN_IN#5,hl$:INPUT#5,al$,al$ 1 27540 DELETE hl$:OPEN_NEW#6,hl$:DIR#6,f$(1 TO 5) 1 27530 hl$=f$(1 TO 5)&"tilaphak_tmp" 1 27520 IF LEN(f$)<5 THEN RETurn 0 1 27510 LOCal hl$(17),al$(37),fbl$(37),etsi,fon 1 27500 DEFine FuNction f_onkof(f$) 1 27200 END DEFine p_mdvherja 1 27190 RETurn 1 27180 PRINT"MISSING OR UNKNOWN DEVICENAME" 1 27170 STRIP 6:INK 2:p_beep1 1 27160 DEFine PROCedure p_mdvherja 1 27140 END DEFine f_nimtark 1 27130 RETurn 1 1 27120 END IF 1 27110 RETurn 0 1 27100 p_beep1:STRIP 6:INK 2:PRINT"MISSING FILENAME" 1 27090 IF pl%<6 THEN 1 27080 IF NOT f$(4)INSTR ml$:p_mdvherja:RETurn 0:END IF 1 27070 IF dl$=="mdv" OR dl$=="ram" THEN ml$="12345678" 1 27060 ml$="1234" 1 27050 IF f$(5)<>"_":p_mdvherja:RETurn 0:END IF 1 27040 IF NOT(dl$=="mdv" OR dl$=="fdk" OR dl$=="flp" OR dl$=="ram"):p_mdvherja:RETurn 0:END IF 1 27030 dl$=f$(1 TO 3) 1 27020 pl%=LEN(f$):IF pl%<5:p_mdvherja:RETurn 0:END IF 1 27010 LOCal pl%,dl$(5),ml$(8) 1 27000 DEFine FuNction f_nimtark(f$) 1 270 DIM apu$(pmax%) 1 260 DIM m$(1) 1 250 DIM b$(pmax%) 1 240 DIM a$(pmax%) 1 230 DIM f2$(mp) 1 220 DIM f1$(mp) 1 2110 END DEFine f_mista$ 1 2100 END REPeat kysy 1 210 DIM f$(mp) 1 2090 INK 2:PRINT"FILE NOT FOUND" 1 2080 p_beep1:STRIP 6:INK 1:PRINT f$!; 1 2070 IF f_onkof((f$)) THEN RETurn f$ 1 2060 IF NOT f_nimtark((f$)) THEN NEXT kysy 1 2050 AT rv%,13:clb=KEYROW(0):INPUT f$:CLS 2 1 2040 PRINT"SOURCE FILE?"; 1 2030 AT rv%,0:PAPER 2:INK 7:CLS 3 1 20210 END DEFine p_isotsake 1 20200 CURSOR#chl%,5,0:PRINT#chl%,ots$:CLOSE#chl% 1 2020 REPeat kysy 1 20190 PAPER#chl%,0:CLS#chl%:CSIZE#chl%,2,0:INK#chl%,5 1 20180 WINDOW#chl%,levl%-4,10,al%+2,37 1 20170 OPEN#chl%,con_ 1 20160 PRINT#chl%,tpvm$:CLOSE#chl% 1 20150 INK#chl%,2:CURSOR#chl%,il2%,0 1 20140 PRINT#chl%,"Timo Salmi" 1 20130 INK#chl%,4:CURSOR#chl%,il1%,0 1 20120 il1%=(il2%+16*LEN(ohj$)-155)/2 1 20110 il2%=levl%-16*LEN(tpvm$)-4 1 20100 INK#chl%,6:PRINT#chl%,ohj$ 1 2010 LOCal f$(mp),kysy 1 20090 CURSOR#chl%,5,0 1 20080 BORDER#chl%,1,7:CSIZE#chl%,3,1 1 20070 PAPER#chl%,0:CLS#chl% 1 20060 WINDOW#chl%,levl%,32,al%,16 1 20050 al%=INT((512-levl%)/2) 1 20040 OPEN#chl%,con_ 1 20030 WINDOW 512,256,0,0:PAPER 0:CLS 1 20020 MODE 8:chl%=5:levl%=448 1 20010 LOCal il1%,il2%,chl%,levl%,al% 1 20000 DEFine PROCedure p_isotsake(ohj$,tpvm$,ots$) 1 2000 DEFine FuNction f_mista$ 1 200 pmax%=20 1 2 REMark Thu 1992 Oct 22 07:00:43 1 19020 END DEFine p_beep1 1 19010 IF bon:BEEP 4000,70:END IF 1 19000 DEFine PROCedure p_beep1 1 180 REPeat runko 1 17080 END DEFine p_ikkunat 1 17070 PAPER#0,0:CSIZE#0,2,0:CLS#0 1 17060 PAPER#1,2:CSIZE#1,2,0:CLS#1 1 17050 WINDOW#0,levl%, 28,al%,228 1 17040 WINDOW#1,levl%,180,al%, 48 1 17030 al%=INT((512-levl%)/2) 1 17020 levl%=448 1 17010 LOCal levl%,al% 1 17000 DEFine PROCedure p_ikkunat 1 160 p_ikkunat 1 150 p_isotsake(ohj$),(tpvm$),(ots$) 1 130 ots$="Change strings in ASCII-file" 1 120 ohj$="REPLACE":tpvm$="07.08.86" 1 110 DIM ohj$(7),tpvm$(8),ots$(mp) 1 100 CLEAR:kokoaika=DATE:mp=37:bon=1 1 1 REMark replace_bas (c) Timo Salmi